{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "#全部行都能输出\n",
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = \"all\"\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# 解决坐标轴刻度负号乱码\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "\n",
    "# 解决中文乱码问题\n",
    "plt.rcParams['font.sans-serif'] = ['Simhei']\n",
    "\n",
    "plt.style.use('ggplot')\n",
    "# plt.figure(figsize=(2,3),dpi=720)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 373,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>颜色深度</th>\n",
       "      <th>酒精浓度</th>\n",
       "      <th>品种</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>140.23</td>\n",
       "      <td>5.64</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>130.20</td>\n",
       "      <td>4.38</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>130.16</td>\n",
       "      <td>5.68</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>140.37</td>\n",
       "      <td>4.80</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>130.24</td>\n",
       "      <td>4.32</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>120.07</td>\n",
       "      <td>2.76</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>120.43</td>\n",
       "      <td>3.94</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>110.79</td>\n",
       "      <td>3.10</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>120.37</td>\n",
       "      <td>2.12</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>120.04</td>\n",
       "      <td>2.60</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     颜色深度  酒精浓度  品种\n",
       "0  140.23  5.64   0\n",
       "1  130.20  4.38   0\n",
       "2  130.16  5.68   0\n",
       "3  140.37  4.80   0\n",
       "4  130.24  4.32   0\n",
       "5  120.07  2.76   1\n",
       "6  120.43  3.94   1\n",
       "7  110.79  3.10   1\n",
       "8  120.37  2.12   1\n",
       "9  120.04  2.60   1"
      ]
     },
     "execution_count": 373,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rowdata = {'颜色深度': [140.23,130.2,130.16,140.37,130.24,120.07,120.43,110.79,120.37,120.04],\n",
    "           '酒精浓度': [5.64,4.38,5.68,4.80,4.32,2.76,3.94,3.1,2.12,2.6],\n",
    "           '品种':     [0,0,0,0,0,1,1,1,1,1]}        \n",
    "\n",
    "# 0 代表 “黑皮诺”，1 代表 “赤霞珠” \n",
    "\n",
    "wine_data = pd.DataFrame(rowdata)\n",
    "\n",
    "wine_data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 计算标记点与所有样本的距离"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "[12.3,4.1]  [14.23,5.64]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "from math import sqrt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.469109151090733"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sqrt((12.3-14.23)**2 + (4.1-5.64) **2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = wine_data.iloc[:,:2].values #将前两列提取出来----data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3.7249, 2.3716],\n",
       "       [0.81  , 0.0784],\n",
       "       [0.7396, 2.4964],\n",
       "       [4.2849, 0.49  ],\n",
       "       [0.8836, 0.0484],\n",
       "       [0.0529, 1.7956],\n",
       "       [0.0169, 0.0256],\n",
       "       [0.2601, 1.    ],\n",
       "       [0.0049, 3.9204],\n",
       "       [0.0676, 2.25  ]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(np.array([[12.3,4.1]])-data) ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3.7249, 0.81  , 0.7396, 4.2849, 0.8836, 0.0529, 0.0169, 0.2601,\n",
       "       0.0049, 0.0676])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = ((np.array([[12.3,4.1]])-data) ** 2)[:,0] #第一列抽取出来\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2.3716, 0.0784, 2.4964, 0.49  , 0.0484, 1.7956, 0.0256, 1.    ,\n",
       "       3.9204, 2.25  ])"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = ((np.array([[12.3,4.1]])-data) ** 2)[:,1] #第二列抽取出来\n",
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2.46910915, 0.94254973, 1.79888855, 2.18515446, 0.96540147,\n",
       "       1.35959553, 0.20615528, 1.12254176, 1.98123699, 1.52236658])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Distance = np.sqrt(a+b)\n",
    "Distance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 对Distance进行排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.20615528, 0.94254973, 0.96540147, 1.12254176, 1.35959553,\n",
       "       1.52236658, 1.79888855, 1.98123699, 2.18515446, 2.46910915])"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sort(Distance)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([6, 1, 4], dtype=int64)"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "K3 = np.argsort(Distance)[:3] #得到开始表的索引值     6 1 4\n",
    "K3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0\n",
       "1    0\n",
       "2    0\n",
       "3    0\n",
       "4    0\n",
       "5    1\n",
       "6    1\n",
       "7    1\n",
       "8    1\n",
       "9    1\n",
       "Name: 品种, dtype: int64"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y = wine_data.品种\n",
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 0, 0]"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[y[i] for i in K3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 判断类别"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([y[i] for i in K3]).value_counts().idxmax()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 总结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "# # 1.把10个训练数据提取到data中\n",
    "# data = wine_data.iloc[:,:2].values #将前两列提取出来----data\n",
    "\n",
    "# # 2. 新数据点与10个一维数组的欧式距离\n",
    "# # 数据点第一个特征与10个点的欧式距离\n",
    "# a = ((np.array([[12.3,4.1]])-data) ** 2)[:,0] #第一列抽取出来\n",
    "# # 数据点第二个特征与10个点的欧式距离\n",
    "# b = ((np.array([[12.3,4.1]])-data) ** 2)[:,1] #第二列抽取出来\n",
    "# # 得到数据点与10个点的欧氏距离\n",
    "# Distance = np.sqrt(a+b)\n",
    "# np.sort(Distance)\n",
    "# # 3.排序找出最近的K个点   K=3\n",
    "# K3 = np.argsort(Distance)[:3] #得到开始表的索引值     6 1 4\n",
    "\n",
    "# # 4.判断类别\n",
    "# y = wine_data.品种\n",
    "# # 根据频数统计判断属于哪一类\n",
    "# pd.Series([y[i] for i in K3]).value_counts().idxmax()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "def KNN(x):  #x是输入的点  返回类别\n",
    "    # 1.把10个训练数据提取到data中\n",
    "    data = wine_data.iloc[:,:2].values #将前两列提取出来----data\n",
    "\n",
    "    # 2. 新数据点与10个一维数组的欧式距离\n",
    "    # 数据点第一个特征与10个点的欧式距离\n",
    "    a = ((x-data) ** 2)[:,0] #第一列抽取出来\n",
    "    # 数据点第二个特征与10个点的欧式距离\n",
    "    b = ((x-data) ** 2)[:,1] #第二列抽取出来\n",
    "    # 得到数据点与10个点的欧氏距离\n",
    "    Distance = np.sqrt(a+b)\n",
    "    np.sort(Distance)\n",
    "    # 3.排序找出最近的K个点   K=3\n",
    "    K3 = np.argsort(Distance)[:3] #得到开始表的索引值     6 1 4\n",
    "\n",
    "    # 4.判断类别\n",
    "    y = wine_data.品种\n",
    "    # 根据频数统计判断属于哪一类\n",
    "    return pd.Series([y[i] for i in K3]).value_counts().idxmax()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "KNN([[12.01,4.1]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 374,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.array(wine_data.iloc[:,0:2]) # X是特征(酒精的属性)\n",
    "y = np.array(wine_data.iloc[:,-1])  # y是标签"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 375,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2875c70bc40>"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2875b53cdf0>"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2875b53cd90>"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x2875b53c190>"
      ]
     },
     "execution_count": 375,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAD2CAYAAAAksGdNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dfVRb9eEG8AeSNDS8yFuBYpesrHYOte0wPSvtdk7XRbpu3WpXtKhMN07X6sRjqzUepyv0KD2MOqeWSdXVDXUada14drSiOZ0Va0WQ9UBxaLGQtOWlrwg0EEhufn/U5teQQChJyL2X5/MX3Hu5eaDk6eV77/3eCJfL5QIREUlaZLgDEBFR4FjmREQywDInIpIBljkRkQywzImIZIBlTkQkA8pwvXBHR0e4XtotOTkZp0+fDneMCZNyfilnB6Sdn9nDJ9D86enpo67jkTkRkQywzImIZIBlTkQkA2EbMx/J5XJhcHAQgiAgIiJiUl6zu7sbdrt9Ul7LH5fLhcjISERFRU3a909E8iGaMh8cHIRKpYJSOXmRlEolFArFpL2ePw6HA4ODg5g+fXq4oxCRxIimzAVBmNQiFyOlUimavxSIpppeay/qy+ph67JBk6aB3qhHnDYu3LHGTTTtyaGFC/hzIJp8vdZe7M3bi15Lr3vZqYZTWGFaIZlC5wnQCRgeHoavmYMFQYDD4QhDIiIKRH1ZvUeRA0Cv5cKRejD0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N+7gO9/j4BfN+A9SNDFGSCTkpI8Znv8+uuvw5xsdA6HA7t378Ztt90GwHumSjFnBy4c3c6aNQurVq1Ca2srqqurJZP/6quvxqlTp7B3715ceeWVcDgcos+u0Wg8ptTw9fsi5t+hkfkvunT2VrHmH5l95HsXCM37d8qV+cUZIO+6665xzfYoFlVVVcjJyUF0dDSA8c1UKSZtbW0wGAyIj4/Hj370I2RmZkom/xtvvIHf/e53yM3NxZVXXomPPvpIMtkv8vX7IrXfoUvfu4B03gMj37tAaLJPqTIfOQOklGZ7bGpqQnV1NYqLi9He3o7PPvtMMtkBIC0tDd3d3QCAo0eP4uTJk5LJf/78eVitVgiCgCNHjuDGG2+UTPaLfP2uS+n339fsrVLJP/K9u3PnzpBkn1IPdN63bx/a2tqwZ88e7NmzB0uXLkVNTQ3OnTvnnu1RrLZu3er+uLi4GEajEUVFRZLIDgDLli1DRUUFPjd4RDYAAACWSURBVP74YzgcDhQXF6OsrEwS+VevXo1nnnkGp06dwty5c/Hzn/9cUj97AFi4cKHPzFL5Pka+d3Nyckb9nsRm5Hv3zjvvdM80G8zsU/4O0P7+fjQ2NiIzM9N9ckIqpJwdkHZ+KWb3lVmK38elpJw/2NmnfJkTEcnBlBozJyKSK5Y5EZEMsMyJiGSAZU5EJAMscyIiGfg/44c5WfhKP4oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "new_data = np.array([12.01,4.1])\n",
    "\n",
    "plt.scatter(X[y==1,0],X[y==1,1],color='red',label='赤霞珠')\n",
    "plt.scatter(X[y==0,0],X[y==0,1],color='purple',label='黑皮诺')\n",
    "plt.scatter(new_data[0],new_data[1],color='yellow')\n",
    "\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 使用sklearn调用KNN"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1], dtype=int64)"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "\n",
    "\n",
    "clf = KNeighborsClassifier(n_neighbors=3)\n",
    "clf = clf.fit(wine_data.iloc[:,0:2],wine_data.iloc[:,-1])\n",
    "\n",
    "clf.predict([[12.01,4.1]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[15.90424478,  5.24782076],\n",
       "       [13.3906354 ,  5.72284434],\n",
       "       [11.00606953,  3.40739179],\n",
       "       [13.98082665,  5.91565097],\n",
       "       [10.61812088,  7.41655318],\n",
       "       [10.70498366,  4.2768393 ],\n",
       "       [10.58844357,  4.16075295],\n",
       "       [12.04350569,  4.68233926],\n",
       "       [13.96249864,  6.11733587],\n",
       "       [10.18353619,  5.01233367]])"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#生成10个黄点\n",
    "a = np.random.normal(11,2,(10,1))\n",
    "b = np.random.normal(5,1,(10,1))\n",
    "\n",
    "new_data = np.concatenate([a,b],axis=1)\n",
    "\n",
    "new_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 1, 0, 0, 1, 1, 0, 0, 1], dtype=int64)"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.predict(new_data)  #拿到模型预测的结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_new = np.array([1, 0, 1, 0, 0, 1, 1, 0, 0, 1])  #实际的红酒类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.score(new_data,y_new)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.        , 0.        ],\n",
       "       [1.        , 0.        ],\n",
       "       [0.        , 1.        ],\n",
       "       [1.        , 0.        ],\n",
       "       [0.66666667, 0.33333333],\n",
       "       [0.        , 1.        ],\n",
       "       [0.        , 1.        ],\n",
       "       [0.66666667, 0.33333333],\n",
       "       [1.        , 0.        ],\n",
       "       [0.        , 1.        ]])"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.predict_proba(new_data) #左边一列是标签为0的概率，右边一列是标签为0的概率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn.datasets import load_breast_cancer\n",
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'data': array([[1.799e+01, 1.038e+01, 1.228e+02, ..., 2.654e-01, 4.601e-01,\n",
       "         1.189e-01],\n",
       "        [2.057e+01, 1.777e+01, 1.329e+02, ..., 1.860e-01, 2.750e-01,\n",
       "         8.902e-02],\n",
       "        [1.969e+01, 2.125e+01, 1.300e+02, ..., 2.430e-01, 3.613e-01,\n",
       "         8.758e-02],\n",
       "        ...,\n",
       "        [1.660e+01, 2.808e+01, 1.083e+02, ..., 1.418e-01, 2.218e-01,\n",
       "         7.820e-02],\n",
       "        [2.060e+01, 2.933e+01, 1.401e+02, ..., 2.650e-01, 4.087e-01,\n",
       "         1.240e-01],\n",
       "        [7.760e+00, 2.454e+01, 4.792e+01, ..., 0.000e+00, 2.871e-01,\n",
       "         7.039e-02]]),\n",
       " 'target': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,\n",
       "        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,\n",
       "        0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0,\n",
       "        1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0,\n",
       "        1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,\n",
       "        1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0,\n",
       "        0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,\n",
       "        1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1,\n",
       "        1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0,\n",
       "        0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0,\n",
       "        1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1,\n",
       "        1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n",
       "        0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1,\n",
       "        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1,\n",
       "        1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0,\n",
       "        0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0,\n",
       "        0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0,\n",
       "        1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1,\n",
       "        1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0,\n",
       "        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1,\n",
       "        1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,\n",
       "        1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1,\n",
       "        1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1,\n",
       "        1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,\n",
       "        1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n",
       "        1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1]),\n",
       " 'frame': None,\n",
       " 'target_names': array(['malignant', 'benign'], dtype='<U9'),\n",
       " 'DESCR': '.. _breast_cancer_dataset:\\n\\nBreast cancer wisconsin (diagnostic) dataset\\n--------------------------------------------\\n\\n**Data Set Characteristics:**\\n\\n    :Number of Instances: 569\\n\\n    :Number of Attributes: 30 numeric, predictive attributes and the class\\n\\n    :Attribute Information:\\n        - radius (mean of distances from center to points on the perimeter)\\n        - texture (standard deviation of gray-scale values)\\n        - perimeter\\n        - area\\n        - smoothness (local variation in radius lengths)\\n        - compactness (perimeter^2 / area - 1.0)\\n        - concavity (severity of concave portions of the contour)\\n        - concave points (number of concave portions of the contour)\\n        - symmetry\\n        - fractal dimension (\"coastline approximation\" - 1)\\n\\n        The mean, standard error, and \"worst\" or largest (mean of the three\\n        worst/largest values) of these features were computed for each image,\\n        resulting in 30 features.  For instance, field 0 is Mean Radius, field\\n        10 is Radius SE, field 20 is Worst Radius.\\n\\n        - class:\\n                - WDBC-Malignant\\n                - WDBC-Benign\\n\\n    :Summary Statistics:\\n\\n    ===================================== ====== ======\\n                                           Min    Max\\n    ===================================== ====== ======\\n    radius (mean):                        6.981  28.11\\n    texture (mean):                       9.71   39.28\\n    perimeter (mean):                     43.79  188.5\\n    area (mean):                          143.5  2501.0\\n    smoothness (mean):                    0.053  0.163\\n    compactness (mean):                   0.019  0.345\\n    concavity (mean):                     0.0    0.427\\n    concave points (mean):                0.0    0.201\\n    symmetry (mean):                      0.106  0.304\\n    fractal dimension (mean):             0.05   0.097\\n    radius (standard error):              0.112  2.873\\n    texture (standard error):             0.36   4.885\\n    perimeter (standard error):           0.757  21.98\\n    area (standard error):                6.802  542.2\\n    smoothness (standard error):          0.002  0.031\\n    compactness (standard error):         0.002  0.135\\n    concavity (standard error):           0.0    0.396\\n    concave points (standard error):      0.0    0.053\\n    symmetry (standard error):            0.008  0.079\\n    fractal dimension (standard error):   0.001  0.03\\n    radius (worst):                       7.93   36.04\\n    texture (worst):                      12.02  49.54\\n    perimeter (worst):                    50.41  251.2\\n    area (worst):                         185.2  4254.0\\n    smoothness (worst):                   0.071  0.223\\n    compactness (worst):                  0.027  1.058\\n    concavity (worst):                    0.0    1.252\\n    concave points (worst):               0.0    0.291\\n    symmetry (worst):                     0.156  0.664\\n    fractal dimension (worst):            0.055  0.208\\n    ===================================== ====== ======\\n\\n    :Missing Attribute Values: None\\n\\n    :Class Distribution: 212 - Malignant, 357 - Benign\\n\\n    :Creator:  Dr. William H. Wolberg, W. Nick Street, Olvi L. Mangasarian\\n\\n    :Donor: Nick Street\\n\\n    :Date: November, 1995\\n\\nThis is a copy of UCI ML Breast Cancer Wisconsin (Diagnostic) datasets.\\nhttps://goo.gl/U2Uwz2\\n\\nFeatures are computed from a digitized image of a fine needle\\naspirate (FNA) of a breast mass.  They describe\\ncharacteristics of the cell nuclei present in the image.\\n\\nSeparating plane described above was obtained using\\nMultisurface Method-Tree (MSM-T) [K. P. Bennett, \"Decision Tree\\nConstruction Via Linear Programming.\" Proceedings of the 4th\\nMidwest Artificial Intelligence and Cognitive Science Society,\\npp. 97-101, 1992], a classification method which uses linear\\nprogramming to construct a decision tree.  Relevant features\\nwere selected using an exhaustive search in the space of 1-4\\nfeatures and 1-3 separating planes.\\n\\nThe actual linear program used to obtain the separating plane\\nin the 3-dimensional space is that described in:\\n[K. P. Bennett and O. L. Mangasarian: \"Robust Linear\\nProgramming Discrimination of Two Linearly Inseparable Sets\",\\nOptimization Methods and Software 1, 1992, 23-34].\\n\\nThis database is also available through the UW CS ftp server:\\n\\nftp ftp.cs.wisc.edu\\ncd math-prog/cpo-dataset/machine-learn/WDBC/\\n\\n.. topic:: References\\n\\n   - W.N. Street, W.H. Wolberg and O.L. Mangasarian. Nuclear feature extraction \\n     for breast tumor diagnosis. IS&T/SPIE 1993 International Symposium on \\n     Electronic Imaging: Science and Technology, volume 1905, pages 861-870,\\n     San Jose, CA, 1993.\\n   - O.L. Mangasarian, W.N. Street and W.H. Wolberg. Breast cancer diagnosis and \\n     prognosis via linear programming. Operations Research, 43(4), pages 570-577, \\n     July-August 1995.\\n   - W.H. Wolberg, W.N. Street, and O.L. Mangasarian. Machine learning techniques\\n     to diagnose breast cancer from fine-needle aspirates. Cancer Letters 77 (1994) \\n     163-171.',\n",
       " 'feature_names': array(['mean radius', 'mean texture', 'mean perimeter', 'mean area',\n",
       "        'mean smoothness', 'mean compactness', 'mean concavity',\n",
       "        'mean concave points', 'mean symmetry', 'mean fractal dimension',\n",
       "        'radius error', 'texture error', 'perimeter error', 'area error',\n",
       "        'smoothness error', 'compactness error', 'concavity error',\n",
       "        'concave points error', 'symmetry error',\n",
       "        'fractal dimension error', 'worst radius', 'worst texture',\n",
       "        'worst perimeter', 'worst area', 'worst smoothness',\n",
       "        'worst compactness', 'worst concavity', 'worst concave points',\n",
       "        'worst symmetry', 'worst fractal dimension'], dtype='<U23'),\n",
       " 'filename': 'C:\\\\ProgramData\\\\Anaconda3\\\\lib\\\\site-packages\\\\sklearn\\\\datasets\\\\data\\\\breast_cancer.csv'}"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>平均半径</th>\n",
       "      <th>平均纹理</th>\n",
       "      <th>平均周长</th>\n",
       "      <th>平均面积</th>\n",
       "      <th>平均光滑度</th>\n",
       "      <th>平均紧凑度</th>\n",
       "      <th>平均凹度</th>\n",
       "      <th>平均凹点</th>\n",
       "      <th>平均对称</th>\n",
       "      <th>平均分形维数</th>\n",
       "      <th>...</th>\n",
       "      <th>最差纹理</th>\n",
       "      <th>最差的边界</th>\n",
       "      <th>最差的区域</th>\n",
       "      <th>最差的平滑度</th>\n",
       "      <th>最差的紧凑性</th>\n",
       "      <th>最差的凹陷</th>\n",
       "      <th>最差的凹点</th>\n",
       "      <th>最差的对称性</th>\n",
       "      <th>最差的分形维数</th>\n",
       "      <th>患病否</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17.99</td>\n",
       "      <td>10.38</td>\n",
       "      <td>122.80</td>\n",
       "      <td>1001.0</td>\n",
       "      <td>0.11840</td>\n",
       "      <td>0.27760</td>\n",
       "      <td>0.3001</td>\n",
       "      <td>0.14710</td>\n",
       "      <td>0.2419</td>\n",
       "      <td>0.07871</td>\n",
       "      <td>...</td>\n",
       "      <td>17.33</td>\n",
       "      <td>184.60</td>\n",
       "      <td>2019.0</td>\n",
       "      <td>0.1622</td>\n",
       "      <td>0.6656</td>\n",
       "      <td>0.7119</td>\n",
       "      <td>0.2654</td>\n",
       "      <td>0.4601</td>\n",
       "      <td>0.11890</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20.57</td>\n",
       "      <td>17.77</td>\n",
       "      <td>132.90</td>\n",
       "      <td>1326.0</td>\n",
       "      <td>0.08474</td>\n",
       "      <td>0.07864</td>\n",
       "      <td>0.0869</td>\n",
       "      <td>0.07017</td>\n",
       "      <td>0.1812</td>\n",
       "      <td>0.05667</td>\n",
       "      <td>...</td>\n",
       "      <td>23.41</td>\n",
       "      <td>158.80</td>\n",
       "      <td>1956.0</td>\n",
       "      <td>0.1238</td>\n",
       "      <td>0.1866</td>\n",
       "      <td>0.2416</td>\n",
       "      <td>0.1860</td>\n",
       "      <td>0.2750</td>\n",
       "      <td>0.08902</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>19.69</td>\n",
       "      <td>21.25</td>\n",
       "      <td>130.00</td>\n",
       "      <td>1203.0</td>\n",
       "      <td>0.10960</td>\n",
       "      <td>0.15990</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>0.12790</td>\n",
       "      <td>0.2069</td>\n",
       "      <td>0.05999</td>\n",
       "      <td>...</td>\n",
       "      <td>25.53</td>\n",
       "      <td>152.50</td>\n",
       "      <td>1709.0</td>\n",
       "      <td>0.1444</td>\n",
       "      <td>0.4245</td>\n",
       "      <td>0.4504</td>\n",
       "      <td>0.2430</td>\n",
       "      <td>0.3613</td>\n",
       "      <td>0.08758</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>11.42</td>\n",
       "      <td>20.38</td>\n",
       "      <td>77.58</td>\n",
       "      <td>386.1</td>\n",
       "      <td>0.14250</td>\n",
       "      <td>0.28390</td>\n",
       "      <td>0.2414</td>\n",
       "      <td>0.10520</td>\n",
       "      <td>0.2597</td>\n",
       "      <td>0.09744</td>\n",
       "      <td>...</td>\n",
       "      <td>26.50</td>\n",
       "      <td>98.87</td>\n",
       "      <td>567.7</td>\n",
       "      <td>0.2098</td>\n",
       "      <td>0.8663</td>\n",
       "      <td>0.6869</td>\n",
       "      <td>0.2575</td>\n",
       "      <td>0.6638</td>\n",
       "      <td>0.17300</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20.29</td>\n",
       "      <td>14.34</td>\n",
       "      <td>135.10</td>\n",
       "      <td>1297.0</td>\n",
       "      <td>0.10030</td>\n",
       "      <td>0.13280</td>\n",
       "      <td>0.1980</td>\n",
       "      <td>0.10430</td>\n",
       "      <td>0.1809</td>\n",
       "      <td>0.05883</td>\n",
       "      <td>...</td>\n",
       "      <td>16.67</td>\n",
       "      <td>152.20</td>\n",
       "      <td>1575.0</td>\n",
       "      <td>0.1374</td>\n",
       "      <td>0.2050</td>\n",
       "      <td>0.4000</td>\n",
       "      <td>0.1625</td>\n",
       "      <td>0.2364</td>\n",
       "      <td>0.07678</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 31 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    平均半径   平均纹理    平均周长    平均面积    平均光滑度    平均紧凑度    平均凹度     平均凹点    平均对称  \\\n",
       "0  17.99  10.38  122.80  1001.0  0.11840  0.27760  0.3001  0.14710  0.2419   \n",
       "1  20.57  17.77  132.90  1326.0  0.08474  0.07864  0.0869  0.07017  0.1812   \n",
       "2  19.69  21.25  130.00  1203.0  0.10960  0.15990  0.1974  0.12790  0.2069   \n",
       "3  11.42  20.38   77.58   386.1  0.14250  0.28390  0.2414  0.10520  0.2597   \n",
       "4  20.29  14.34  135.10  1297.0  0.10030  0.13280  0.1980  0.10430  0.1809   \n",
       "\n",
       "    平均分形维数  ...   最差纹理   最差的边界   最差的区域  最差的平滑度  最差的紧凑性   最差的凹陷   最差的凹点  \\\n",
       "0  0.07871  ...  17.33  184.60  2019.0  0.1622  0.6656  0.7119  0.2654   \n",
       "1  0.05667  ...  23.41  158.80  1956.0  0.1238  0.1866  0.2416  0.1860   \n",
       "2  0.05999  ...  25.53  152.50  1709.0  0.1444  0.4245  0.4504  0.2430   \n",
       "3  0.09744  ...  26.50   98.87   567.7  0.2098  0.8663  0.6869  0.2575   \n",
       "4  0.05883  ...  16.67  152.20  1575.0  0.1374  0.2050  0.4000  0.1625   \n",
       "\n",
       "   最差的对称性  最差的分形维数  患病否  \n",
       "0  0.4601  0.11890  0.0  \n",
       "1  0.2750  0.08902  0.0  \n",
       "2  0.3613  0.08758  0.0  \n",
       "3  0.6638  0.17300  0.0  \n",
       "4  0.2364  0.07678  0.0  \n",
       "\n",
       "[5 rows x 31 columns]"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "load_breast_cancer()\n",
    "\n",
    "#读取数据集\n",
    "data = load_breast_cancer()\n",
    "\n",
    "#DateFrame格式显示\n",
    "X = data.data\n",
    "y = data.target\n",
    "name = ['平均半径','平均纹理','平均周长','平均面积',\n",
    "        '平均光滑度','平均紧凑度','平均凹度',\n",
    "        '平均凹点','平均对称','平均分形维数',\n",
    "        '半径误差','纹理误差','周长误差','面积误差',\n",
    "        '平滑度误差','紧凑度误差','凹度误差',\n",
    "        '凹点误差','对称误差',\n",
    "        '分形维数误差','最差半径','最差纹理',\n",
    "        '最差的边界','最差的区域','最差的平滑度',\n",
    "        '最差的紧凑性','最差的凹陷','最差的凹点',\n",
    "        '最差的对称性','最差的分形维数','患病否']\n",
    "\n",
    "data=np.concatenate((X,y.reshape(-1,1)),axis=1)\n",
    "table=pd.DataFrame(data=data,columns=name)\n",
    "table.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 划分测试集与训练集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>平均半径</th>\n",
       "      <th>平均纹理</th>\n",
       "      <th>平均周长</th>\n",
       "      <th>平均面积</th>\n",
       "      <th>平均光滑度</th>\n",
       "      <th>平均紧凑度</th>\n",
       "      <th>平均凹度</th>\n",
       "      <th>平均凹点</th>\n",
       "      <th>平均对称</th>\n",
       "      <th>平均分形维数</th>\n",
       "      <th>...</th>\n",
       "      <th>最差半径</th>\n",
       "      <th>最差纹理</th>\n",
       "      <th>最差的边界</th>\n",
       "      <th>最差的区域</th>\n",
       "      <th>最差的平滑度</th>\n",
       "      <th>最差的紧凑性</th>\n",
       "      <th>最差的凹陷</th>\n",
       "      <th>最差的凹点</th>\n",
       "      <th>最差的对称性</th>\n",
       "      <th>最差的分形维数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17.99</td>\n",
       "      <td>10.38</td>\n",
       "      <td>122.80</td>\n",
       "      <td>1001.0</td>\n",
       "      <td>0.11840</td>\n",
       "      <td>0.27760</td>\n",
       "      <td>0.3001</td>\n",
       "      <td>0.14710</td>\n",
       "      <td>0.2419</td>\n",
       "      <td>0.07871</td>\n",
       "      <td>...</td>\n",
       "      <td>25.38</td>\n",
       "      <td>17.33</td>\n",
       "      <td>184.60</td>\n",
       "      <td>2019.0</td>\n",
       "      <td>0.1622</td>\n",
       "      <td>0.6656</td>\n",
       "      <td>0.7119</td>\n",
       "      <td>0.2654</td>\n",
       "      <td>0.4601</td>\n",
       "      <td>0.11890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20.57</td>\n",
       "      <td>17.77</td>\n",
       "      <td>132.90</td>\n",
       "      <td>1326.0</td>\n",
       "      <td>0.08474</td>\n",
       "      <td>0.07864</td>\n",
       "      <td>0.0869</td>\n",
       "      <td>0.07017</td>\n",
       "      <td>0.1812</td>\n",
       "      <td>0.05667</td>\n",
       "      <td>...</td>\n",
       "      <td>24.99</td>\n",
       "      <td>23.41</td>\n",
       "      <td>158.80</td>\n",
       "      <td>1956.0</td>\n",
       "      <td>0.1238</td>\n",
       "      <td>0.1866</td>\n",
       "      <td>0.2416</td>\n",
       "      <td>0.1860</td>\n",
       "      <td>0.2750</td>\n",
       "      <td>0.08902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>19.69</td>\n",
       "      <td>21.25</td>\n",
       "      <td>130.00</td>\n",
       "      <td>1203.0</td>\n",
       "      <td>0.10960</td>\n",
       "      <td>0.15990</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>0.12790</td>\n",
       "      <td>0.2069</td>\n",
       "      <td>0.05999</td>\n",
       "      <td>...</td>\n",
       "      <td>23.57</td>\n",
       "      <td>25.53</td>\n",
       "      <td>152.50</td>\n",
       "      <td>1709.0</td>\n",
       "      <td>0.1444</td>\n",
       "      <td>0.4245</td>\n",
       "      <td>0.4504</td>\n",
       "      <td>0.2430</td>\n",
       "      <td>0.3613</td>\n",
       "      <td>0.08758</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>11.42</td>\n",
       "      <td>20.38</td>\n",
       "      <td>77.58</td>\n",
       "      <td>386.1</td>\n",
       "      <td>0.14250</td>\n",
       "      <td>0.28390</td>\n",
       "      <td>0.2414</td>\n",
       "      <td>0.10520</td>\n",
       "      <td>0.2597</td>\n",
       "      <td>0.09744</td>\n",
       "      <td>...</td>\n",
       "      <td>14.91</td>\n",
       "      <td>26.50</td>\n",
       "      <td>98.87</td>\n",
       "      <td>567.7</td>\n",
       "      <td>0.2098</td>\n",
       "      <td>0.8663</td>\n",
       "      <td>0.6869</td>\n",
       "      <td>0.2575</td>\n",
       "      <td>0.6638</td>\n",
       "      <td>0.17300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20.29</td>\n",
       "      <td>14.34</td>\n",
       "      <td>135.10</td>\n",
       "      <td>1297.0</td>\n",
       "      <td>0.10030</td>\n",
       "      <td>0.13280</td>\n",
       "      <td>0.1980</td>\n",
       "      <td>0.10430</td>\n",
       "      <td>0.1809</td>\n",
       "      <td>0.05883</td>\n",
       "      <td>...</td>\n",
       "      <td>22.54</td>\n",
       "      <td>16.67</td>\n",
       "      <td>152.20</td>\n",
       "      <td>1575.0</td>\n",
       "      <td>0.1374</td>\n",
       "      <td>0.2050</td>\n",
       "      <td>0.4000</td>\n",
       "      <td>0.1625</td>\n",
       "      <td>0.2364</td>\n",
       "      <td>0.07678</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 30 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    平均半径   平均纹理    平均周长    平均面积    平均光滑度    平均紧凑度    平均凹度     平均凹点    平均对称  \\\n",
       "0  17.99  10.38  122.80  1001.0  0.11840  0.27760  0.3001  0.14710  0.2419   \n",
       "1  20.57  17.77  132.90  1326.0  0.08474  0.07864  0.0869  0.07017  0.1812   \n",
       "2  19.69  21.25  130.00  1203.0  0.10960  0.15990  0.1974  0.12790  0.2069   \n",
       "3  11.42  20.38   77.58   386.1  0.14250  0.28390  0.2414  0.10520  0.2597   \n",
       "4  20.29  14.34  135.10  1297.0  0.10030  0.13280  0.1980  0.10430  0.1809   \n",
       "\n",
       "    平均分形维数  ...   最差半径   最差纹理   最差的边界   最差的区域  最差的平滑度  最差的紧凑性   最差的凹陷   最差的凹点  \\\n",
       "0  0.07871  ...  25.38  17.33  184.60  2019.0  0.1622  0.6656  0.7119  0.2654   \n",
       "1  0.05667  ...  24.99  23.41  158.80  1956.0  0.1238  0.1866  0.2416  0.1860   \n",
       "2  0.05999  ...  23.57  25.53  152.50  1709.0  0.1444  0.4245  0.4504  0.2430   \n",
       "3  0.09744  ...  14.91  26.50   98.87   567.7  0.2098  0.8663  0.6869  0.2575   \n",
       "4  0.05883  ...  22.54  16.67  152.20  1575.0  0.1374  0.2050  0.4000  0.1625   \n",
       "\n",
       "   最差的对称性  最差的分形维数  \n",
       "0  0.4601  0.11890  \n",
       "1  0.2750  0.08902  \n",
       "2  0.3613  0.08758  \n",
       "3  0.6638  0.17300  \n",
       "4  0.2364  0.07678  \n",
       "\n",
       "[5 rows x 30 columns]"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "0    0.0\n",
       "1    0.0\n",
       "2    0.0\n",
       "3    0.0\n",
       "4    0.0\n",
       "Name: 患病否, dtype: float64"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X = table.iloc[:,:-1] #X 特征 \n",
    "y = table.iloc[:,-1] #y 标签  \n",
    "X.head()\n",
    "y.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9298245614035088"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "#划分训练集(Xtrain,Ytrain)和测试集(Xtest,Ytest)\n",
    "#random_state 随机种子 类似于random.seed()\n",
    "Xtrain,Xtest,Ytrain,Ytest = train_test_split(X,y,test_size=0.2,random_state=420)  \n",
    "\n",
    "#建模\n",
    "clf = KNeighborsClassifier(n_neighbors=2)\n",
    "\n",
    "clf = clf.fit(Xtrain,Ytrain)\n",
    "\n",
    "score = clf.score(Xtest,Ytest)\n",
    "\n",
    "score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 绘制学习曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2875c1a1850>]"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "([<matplotlib.axis.XTick at 0x2875baa3730>,\n",
       "  <matplotlib.axis.XTick at 0x287580a2af0>,\n",
       "  <matplotlib.axis.XTick at 0x287557093a0>,\n",
       "  <matplotlib.axis.XTick at 0x2875c032970>,\n",
       "  <matplotlib.axis.XTick at 0x2875bf02ee0>,\n",
       "  <matplotlib.axis.XTick at 0x2875800f190>,\n",
       "  <matplotlib.axis.XTick at 0x2875bf02610>,\n",
       "  <matplotlib.axis.XTick at 0x2875bb871c0>,\n",
       "  <matplotlib.axis.XTick at 0x2875bb87d90>,\n",
       "  <matplotlib.axis.XTick at 0x2875bd3a070>,\n",
       "  <matplotlib.axis.XTick at 0x2875bca2eb0>,\n",
       "  <matplotlib.axis.XTick at 0x287585790d0>,\n",
       "  <matplotlib.axis.XTick at 0x2875bdcb640>,\n",
       "  <matplotlib.axis.XTick at 0x2875bc9f910>,\n",
       "  <matplotlib.axis.XTick at 0x2875bc9fd30>,\n",
       "  <matplotlib.axis.XTick at 0x2875becaf10>,\n",
       "  <matplotlib.axis.XTick at 0x2875bc9feb0>,\n",
       "  <matplotlib.axis.XTick at 0x2875b479550>,\n",
       "  <matplotlib.axis.XTick at 0x2875bb87250>],\n",
       " <a list of 19 Text major ticklabel objects>)"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<function matplotlib.pyplot.show(*args, **kw)>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD2CAYAAADcUJy6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3de3BU55nn8e8rBBJCIFkIGQQYIZAccGwZbGKQwYpBkW9ysYlczCxJUfuHZypT2aktV1KppDI2CltM2KTGyWTGxlMTe5aYrWKLtYciJr7J4maDMTiWsWXLwqgRYDVqCSyD7mr63T9akkEXpL6pu0//PlWpIPqcp5/unPw4Ov30e4y11iIiIo6TFO0GREQkMhTwIiIOpYAXEXEoBbyIiEMp4EVEHEoBLyLiUMnRbuBaTU1NQe2XnZ1Na2trSM+tGqoR6zVioQfViL0aubm5oz6mM3gREYdSwIuIOJQCXkTEoRTwIiIOpYAXEXEoBbyIiEMp4EVEHEoBLzHLvv8O3gtfRLuNmGC7O+l8Yw/26tVotyJxRAEvMcleOI/vuf/FlT88He1WYoJ9/T+5sv3X2PffiXYrEkcU8BKTbPU+AHrfP4ptDu4bzk5h+/qwB1/z/7n6lSh3I/FEAS8xx3Z1Yo9Uw23LYNIk7P590W4pquyJt+HKV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WW27hxIkTAe+/Z88eysrKmDZtWtA9LFiwgJtuugnwz9S63e6Aa7hcLkpLS8nMzGTNmjXU1tYG1YvP5wvp18zdu3fzN3/zNzz22GPMnTuXAwcOBLR/RUUFy5Yto7q6mpKSElJTU4PqAyA1NXXwUkR3dzc+ny/oWqHSsfo1pxyrEN7j9VoJH/Ber5enn36ajRs3MmvWrKBq7Nmzh4MHDwL+D22D+Y3io48+4vXXX6eyspIzZ87w3HPPBVzjX/7lXzhz5gw+n4/jx4+zYMGCgGvMnj2b5uZmABoaGsjOzg64BkBdXR0FBQUYY4Lav6Ojg7Nnz+Lz+Th16lRQNfLy8mhtbaW8vDyo/Qfk5+cPXpZpbGwkJycnpHrB0rF6PScdqxC+4/Vacf8ha6iqq6txuVy8/PLLvPzyy5SVlVFcXBxQjdLSUn77299SXV3N/Pnzg/oE/Je//OXgnysrK/nhD38YcI3HHnuM3//+91hrufvuuwev1wZi7dq1bN++nSNHjuD1evnxj38ccA2AmpoalixZEtS+AN/97nd59tlnaWlpobCwkNWrVwdcY+/evZSXlwc90TRgxYoVbN68mS+//JKamhq2bt0aUr1g6Vi9npOOVQjf8XotfZNVZBwGZseXLl0a9IfgIhNNAS8i4lAJfw1eRMSpFPAiIg6lgBcRcSgFvIiIQyngRUQc6v8DN9BaqlKeR6QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "score = [] # 得分列表\n",
    "k = range(1,20) # k的范围\n",
    "\n",
    "for i in k:\n",
    "    clf = KNeighborsClassifier(n_neighbors=i) \n",
    "    clf = clf.fit(Xtrain,Ytrain)\n",
    "    score.append(clf.score(Xtest,Ytest))\n",
    "\n",
    "plt.plot(k,score)\n",
    "plt.xticks(range(1,20)) #x轴换成1-20\n",
    "plt.show\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于我们建模来讲：\n",
    "1.评分（准确率）\n",
    "2.稳定性------取决于在不同的数据集都能得到稳定的高分数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 带交叉验证的学习曲线"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 划分特征数据X与标签y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 402,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = table.iloc[:,:-1]\n",
    "y = table.iloc[:,-1]\n",
    "#X.head(),y.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 划分数据集和测试集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 409,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "Xtrain,Xtest,Ytrain,Ytest = train_test_split(X,y,test_size=0.2,random_state=400)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 建模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 410,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn.model_selection import cross_val_score as CVS\n",
    "from sklearn.preprocessing import MinMaxScaler as mms"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 417,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x287621a7820>]"
      ]
     },
     "execution_count": 417,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x287621a79a0>]"
      ]
     },
     "execution_count": 417,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x287621a72e0>]"
      ]
     },
     "execution_count": 417,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "([<matplotlib.axis.XTick at 0x287622b8cd0>,\n",
       "  <matplotlib.axis.XTick at 0x287622b84c0>,\n",
       "  <matplotlib.axis.XTick at 0x287626328e0>,\n",
       "  <matplotlib.axis.XTick at 0x2876231d670>,\n",
       "  <matplotlib.axis.XTick at 0x2876231d040>,\n",
       "  <matplotlib.axis.XTick at 0x287622c4040>,\n",
       "  <matplotlib.axis.XTick at 0x287622c4940>,\n",
       "  <matplotlib.axis.XTick at 0x287622c4250>,\n",
       "  <matplotlib.axis.XTick at 0x2876232b370>,\n",
       "  <matplotlib.axis.XTick at 0x2876232b0d0>,\n",
       "  <matplotlib.axis.XTick at 0x287622c4820>,\n",
       "  <matplotlib.axis.XTick at 0x2876231d5e0>,\n",
       "  <matplotlib.axis.XTick at 0x2876232b970>,\n",
       "  <matplotlib.axis.XTick at 0x28762318040>,\n",
       "  <matplotlib.axis.XTick at 0x28762318520>,\n",
       "  <matplotlib.axis.XTick at 0x28762318940>,\n",
       "  <matplotlib.axis.XTick at 0x28762318f10>,\n",
       "  <matplotlib.axis.XTick at 0x28760cc46a0>,\n",
       "  <matplotlib.axis.XTick at 0x287628179d0>],\n",
       " <a list of 19 Text major ticklabel objects>)"
      ]
     },
     "execution_count": 417,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAD2CAYAAADbPoDqAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOydeVhUZfvHP7MwDPuwuOMSianlgoo/9xU1DZfCfcsVd3G38lWRci1TFCFBfbVUMLfyzd3M1DQ1TU2S1CRTQ9lBdmbm/P4AJxAQhEFQn891cemc5znfc58Zhvs8y33fMkmSJAQCgUDwyiIvawMEAoFAULYIRyAQCASvOMIRCAQCwSuOcAQCgUDwiiMcgUAgELziCEcgEAgErzjKsjagOPzzzz/FOs/BwYHo6OgSX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TtUZ4SEhPDyyy9jNBo5f/683/1PnjxJfn4+0dHRqseQkJBAXFwc0Lcm2ePx+J3R2NhIXl4eer2eZ555BqfTqWosiqJM6vD2xIkTvPLKKxQUFLBkyRLOnj3rV3+r1crq1as5c+YMubm5aLVaVeMA0Gq1g6dAOjs7URRFddZkyVz9l5kyVyGw8/VBUggmqLe3l7feeovCwkLmz5+vKuPkyZN8/PHHQN/FZzVHKHa7nVOnTrFnzx6ampr4/e9/73dGWVkZTU1NKIpCTU0NCQkJfmc89thjXL9+HYCGhgYMBoPfGQAul4vk5GRCQkJU9b937x5ffPEFiqJQV1enKiMxMZGWlhYsFouq/gNMJtPg6aDm5mYWLFgwqTy1ZK4ONZPmKgRuvj5o1lwsnqwzZ87Q2NhIRUUFFRUV5Ofnk5OT41dGXl4eBw4c4MyZMyxbtkzVFf+f//zng1/v2bOHV1991e+MgoICSktL8fl8ZGRkDJ5P9sf69espLy/ns88+o7e3l9dff93vDACbzcaKFStU9QV4/vnnOXToEDdv3sRsNrNu3Tq/MyorK7FYLKpXcA3IzMykqKiI1tZWbDYbxcXFk8pTS+bqUDNprkLg5uuD5M5iIQJoYO19SkqK6ov5QjxqUgiEEGKWk2sEQggxy0khEEKIWU4KgRBCzHJSCIQQYpaTQiCEELPc/wMarJHhu3NexgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#归一化 \n",
    "Xtrain = mms().fit(Xtrain).transform(Xtrain)\n",
    "Xtest = mms().fit(Xtest).transform(Xtest)\n",
    "\n",
    "mean = []\n",
    "var = []\n",
    "\n",
    "for i in range(1,20):\n",
    "    #K值不能设置过大、过小  ----学习曲线\n",
    "    # 当我们的样本分布很不均匀的时候可以通过设置weights='distance'进行调优\n",
    "    KNN = KNeighborsClassifier(n_neighbors=i,weights='distance') #K 设置的范围  1-19\n",
    "    #交叉验证  折数不能过大  过小  \n",
    "    result = CVS(KNN,Xtrain,Ytrain,cv=5) #5、6折\n",
    "    \n",
    "    mean.append(result.mean()) #均值\n",
    "    var.append(result.var()) #方差\n",
    "\n",
    "mean = np.array(mean)    \n",
    "var = np.array(var)      \n",
    "plt.plot(range(1,20),mean,color='k')\n",
    "plt.plot(range(1,20),mean+var*5,color='r',linestyle='--')\n",
    "plt.plot(range(1,20),mean-var*5,color='r',linestyle='--')\n",
    "plt.xticks(range(1,20))\n",
    "plt.show()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 344,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.956140350877193"
      ]
     },
     "execution_count": 344,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "KNN_K10 = KNeighborsClassifier(n_neighbors=14)\n",
    "clf_k10 = KNN_K10.fit(Xtrain,Ytrain) #训练模型\n",
    "\n",
    "clf_k10.score(Xtest,Ytest)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 归一化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Python实现"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 378,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.00\n",
       "1    0.25\n",
       "2    0.50\n",
       "3    1.00\n",
       "Name: 0, dtype: float64"
      ]
     },
     "execution_count": 378,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = [[-1,2],[-0.5,6],[0,10],[1,18]]\n",
    "data_01=pd.DataFrame(data).iloc[:,0] #对第一列进行归一化\n",
    "\n",
    "\n",
    "(data_01-np.min(data_01,axis=0))/(np.max(data_01,axis=0)-np.min(data_01,axis=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "224.583px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
